package com.ldu.houserent.common.vo;

import lombok.Data;

/**
 * 房屋搜素封装参数
 */
@Data
public class HouseSearchVO {
    //搜索需要实现翻页功能
    //页码
    private Integer page = 1;
    //页大小
    private Integer size = 6;
    //房屋租赁状态，0代表未租出
    private Integer status = 0;
    //地址关键字，实现模糊查询
    private String address = "";
    //城市名称
    private String city = "";
    //租房类型
    private String rentType = "";
    //月租金范围，已分号隔开
    private String priceRange = "1000;10000";
    //最小价格
    private Integer minPrice = 0;
    //最大价格
    private Integer maxPrice = 20000;
    //房屋面积范围，以分号分割
    private String areaRange = "0;150";
    //最小面积
    private Integer minArea = 0;
    //最大面积
    private Integer maxArea = 400;

    //获得分页前缀参数
    public String getPagePrefix(){
        StringBuilder sb = new StringBuilder();
        sb.append("?address=").append(this.address);
        sb.append("&city=").append(this.city);
        sb.append("&rentType=").append(this.rentType);
        sb.append("&priceRange=").append(this.priceRange);
        sb.append("&areaRange=").append(this.areaRange);
        return sb.toString();
    }

}
